<template>
	<view class="page">
		<view class="">
			<uni-table stripe emptyText="暂无更多数据">
				<uni-tr>
					<uni-th width="100" align="center">电机</uni-th>
					<uni-th width="100" align="center">水侵</uni-th>
					<uni-th width="100" align="center">压力</uni-th>
				</uni-tr>
				<uni-tr>
					<uni-td align="center">{{detail.m1+' '}}{{detail.m2+' '}}{{detail.m3+' '}}</uni-td>
					<uni-td align="center">{{detail.w1+' '}}{{detail.w2+'  '}}{{detail.w3+' '}}</uni-td>
					<uni-td align="center">{{detail.adc}}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isSwitch: true,
				imei: '',
				detail: {
					adc: '',
					m1: '',
					m2: '',
					m3: '',
					w1: '',
					w2: '',
					w3: ''
				}
			}
		},
		onLoad(options) {
			if(options) {
				this.imei = options.imei
			}
			this.getDetail()
		},
		created() {
			
		},
		methods: {
			getDetail() {
				let url = "https://wxwater.beihuaintel.com/water/motor_state?imei="+this.imei
				uni.request({
					url: url,
					method: 'GET',
					dataType: 'json',
					success: (res) => {
						console.log(res)
						this.detail = {...res.data}
					}
				})
			}
		}
	}
</script>

<style>

</style>
